<?php
/**
 * Created by PhpStorm.
 * User: dy
 * Date: 2019/12/19
 * Time: 16:58
 */
namespace app\admin\validate;
use app\common\validate\BaseValidate;

class LoginValidate extends BaseValidate
{
    // 验证规则
    protected $rule =   [
        'username'  => 'require',
        'password'  => 'require',
        'verify'    => 'require|captcha',
    ];

    // 验证提示
    protected $message  =   [
        'username.require'    => '用户名不能为空',
        'password.require'    => '密码不能为空',
        'verify.require'      => '验证码不能为空',
        'verify.captcha'      => '验证码不正确',
    ];

    // 应用场景
    protected $scene = [
        'admin'   =>  ['username','password', 'verify'],
    ];
}